package com.thexb.sys.mapper;

import com.thexb.sys.entity.Role;
import com.thexb.sys.entity.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author thexb
 * @since 2023-04-04
 */
public interface UserMapper extends BaseMapper<User> {
    @Select("""
        select role_name from x_role
        where role_id in (
            select role_id from x_user_role
            where id = 1
        )
    """)
    public List<String> getRoleNameByUserId(int id);
}
